<?php
    $Bookshelf = new NaturalExtension_Bookshelf();
?>

<div id="natext" class="wrap">
    <div class="bookshelf">
        <div class="icon32 main-icon"></div>
        <h2>Bookshelf</h2>

        <br>
        <br>
        <div class="shelf-surface">
            <div class="book-collection">
                <ul class="books">
                    <?php $Bookshelf->display_books(); ?>
                </ul>
                <div class="add-new">
                    <a href="#" title="Add New Book">+</a>
                </div>
            </div>
        </div>

        <br>

        <div class="editor cf" data-mode="normal" data-post-id="">
            <form action="<?php echo admin_url('admin-ajax.php'); ?>" method="post" class="editor-form">
                <div class="left-col">
                    <div class="book">
                        <div class="featured-image">
                            <img class="attachment-medium wp-post-image" src="<?php echo OF_DIRECTORY; ?>/patch/images/dummy-book-cover.jpg">
                        </div>
                        <br>
                        <a href="<?php echo admin_url('media-upload.php'); ?>?post_id=0&amp;type=image&amp;TB_iframe=true" class="set-featured-image thickbox">Add book cover</a>
                        <a href="#" class="remove-featured-image hidden">Remove book cover</a>
                        <input type="hidden" name="featured_image_id">
                    </div>
                </div>
                <div class="right-col">
                    <input type="text" name="post_title" tabindex="1" autocomplete="off" placeholder="Enter title here">
                    <br>
                    <br>
                    <?php wp_editor('', 'book-content', array('textarea_name' => 'book_content')); ?>
                    <br>
                    <ul>
                        <li>
                            <label for="bookstore_link">Bookstore link</label>
                            <input type="text" size="80" autocomplete="off" name="bookstore_link" placeholder="dont forget the http://">
                        </li>
                        <li>
                            <label for="excerpt" style="vertical-align: top;">Description Excerpt</label>
                            <textarea name="excerpt_home" cols="100" rows="5" placeholder="Place your custom excerpt here. It will be displayed on your home page and books page."></textarea>
                        </li>
                        <li>
                            <label for="excerpt_book" style="vertical-align: top;">Description Excerpt<br>(book page override)</label>
                            <textarea name="excerpt_book" cols="100" rows="5" placeholder="Place your custom excerpt here. This will override your excerpt above and will be displayed on books page only."></textarea>
                        </li>
                        <li>
                            <label for="excerpt_pages" style="vertical-align: top;">Excerpt pages</label>
                            <textarea name="excerpt_pages" cols="100" rows="5" placeholder="Put the desired excerpt pages here."></textarea>
                        </li>
                        <li>
                            <label>&nbsp;</label>
                            <input type="checkbox" name="bookstore_auto_content" checked>
                            <label for="bookstore_auto_content">Automatically add cover image and order button</label>
                        </li>
                        <li>
                            <br>
                            <label></label>
                            <input type="submit" class="button-primary build-button" value="Save Book">
                            <input type="button" class="button-secondary build-button cancel-button" value="Cancel">
                        </li>
                    </ul>
                </div>
            </form>
        </div>
    </div>
</div>